from selenium.webdriver.common.by import By


class  AdminNotificationRecordLocator:

    #notification records菜单
    notification_record_tab = (By.CSS_SELECTOR, '[path="/console/messageCenter/records"]')

    #record搜索功能
    #搜索类型
    search_type = (By.XPATH,'//*[@id="creForm"]/div[1]/div/div')
    search_type_value = (By.CSS_SELECTOR,'[title="Notification Type"]')

    #账号类型选择框
    account_type = (By.XPATH,'//*[@id="creForm"]/div[2]/div/div/div/div')
    account_type_value = (By.CSS_SELECTOR,'[title="Enterprise Account"]')
    account_type_value_admin = (By.CSS_SELECTOR, '[title="Platform"]')


    search_notification_type = (By.XPATH,'//*[@id="creForm"]/div[2]/div/div/div/div')
    notification_type_value = (By.CSS_SELECTOR, '[title="System"]')


    #搜索内容
    search_keywords = (By.XPATH,'//*[@id="creForm_searchTarget"]')
    search_keywords_template = (By.ID,'creForm_messageTemplateName')

    #搜索按钮
    search_button = (By.XPATH,'//button[contains(@class,"antd4-btn-primary")]')

    #重置按钮
    reset_button = (By.XPATH,'//button[contains(@class,"antd4-btn-default")]')

    #表格表头
    notification_title = (By.XPATH,'(//th[contains(@class,"antd4-table-cell")])[1]')
    account_type_table = (By.XPATH,'(//th[contains(@class,"antd4-table-cell")])[2]')
    account_email = (By.XPATH,'(//th[contains(@class,"antd4-table-cell")])[3]')
    notification_type = (By.XPATH,'(//th[contains(@class,"antd4-table-cell")])[4]')
    channel = (By.XPATH,'(//th[contains(@class,"antd4-table-cell")])[5]')
    send_time = (By.XPATH,'(//th[contains(@class,"antd4-table-cell")])[6]')
    send_statis = (By.XPATH,'(//span[contains(@class,"antd4-table-column-title")])[1]')
    read_status = (By.XPATH,'(//span[contains(@class,"antd4-table-column-title")])[2]')

    #搜索结果中第一条记录的email
    search_record_email = (By.XPATH,'//*[@id="root"]/section/section/main/div/div/div/div/div[2]/div/div/div[2]/div/div/div/div/div/div/div/div/table/tbody/tr[2]/td[3]/div')

    #搜索结果中第一条记录的title
    search_record_title = (By.XPATH,'//*[@class="antd4-table-tbody"]/tr[2]/td[1]//span')

    # 搜索结果中第一条记录的title的按钮
    search_record_title_button = (By.XPATH,'//*[@class="antd4-table-tbody"]/tr[2]/td[1]/button')

    # 搜索结果中第2条记录的title的按钮
    search_record_title_second = (By.XPATH,'//*[@class="antd4-table-tbody"]/tr[3]/td[1]//span')
    #页面空数据
    empty_data = (By.XPATH,'//div[contains(@class,"antd4-empty-description")]')

    #详情页标题
    detail_title = (By.XPATH,'//*[@id="rc_unique_1"]/div/div[1]')

    #搜索记录数
    total_count = (By.XPATH,'//li[contains(@class,"antd4-pagination-total-text")]')

    #翻页按钮-下一个
    next_button = (By.XPATH,'(//button[contains(@class,"antd4-btn-circle")])[1]')

    #翻页按钮-上一个
    previous_button = (By.XPATH,'(//button[contains(@class,"antd4-btn-circle")])[2]')